<?php

/**
 * Afiliado form base class.
 *
 * @package    form
 * @subpackage afiliado
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseAfiliadoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'dni'            => new sfWidgetFormInput(),
      'nombre'         => new sfWidgetFormInput(),
      'apellido'       => new sfWidgetFormInput(),
      'id_dependencia' => new sfWidgetFormDoctrineSelect(array('model' => 'Dependencia', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorDoctrineChoice(array('model' => 'Afiliado', 'column' => 'id', 'required' => false)),
      'dni'            => new sfValidatorInteger(),
      'nombre'         => new sfValidatorString(array('max_length' => 255)),
      'apellido'       => new sfValidatorString(array('max_length' => 255)),
      'id_dependencia' => new sfValidatorDoctrineChoice(array('model' => 'Dependencia')),
    ));

    $this->widgetSchema->setNameFormat('afiliado[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Afiliado';
  }

}